********************************************************************************
********************************************************************************
*********** Racial Resentment vs. Principled Conservatism: 2004 Data ***********
********************************************************************************
********************************************************************************

use "Clean Data, 2004"

********************************************************************************	
	
****
** Correlational analyses
****	

corrci ideo2 spending2
corrci ideo2 biggov2 

corrci ideo2 raceresentsum2
corrci spending2 raceresentsum2
corrci biggov2 raceresentsum2

****
** IRT-Logit DIF analyses
****

sum spending2 if conserv == 1 
gen dumspend = 0 if spending2 <= .4273823
replace dumspend = 1 if spending2 > .4273823

sum spending2
gen dumspend2 = 0 if spending2 <= .325012
replace dumspend2 = 1 if spending2 > .325012


sum biggov2 if conserv == 1
gen dumgov = 0 if spending2 <= .6654135
replace dumgov = 1 if spending2 > .6654135

sum biggov2
gen dumgov2 = 0 if spending2 <= .4783951
replace dumgov2 = 1 if spending2 > .4783951


preserve
difdetect favors conditions deserve tryhard, ru(spend) ///
	ab(origirt) gr(dumspend)
keep caseid theta_spend
*save "theta_spend.dta", replace	
restore	
	
preserve	
difdetect favors conditions deserve tryhard, ru(conserv) ///
	ab(origirt) gr(conserv) 
keep caseid theta_conserv
*save "theta_conserv.dta", replace	
restore	
	
preserve	
difdetect favors conditions deserve tryhard, ru(gov) ///
	ab(origirt) gr(dumgov)
keep caseid theta_gov
*save "theta_gov.dta", replace	
restore	

********************************************************************************
	
*****
** MIMIC approach to DIF
** detection (results appear
** in supplemental appendix)
*****	
	
* Spending attitudes
sem (RR -> favors conditions deserve tryhard) ///
	(dumspend -> RR)
estat mindices


gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumspend -> RR favors, ologit)

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumspend -> RR conditions, ologit)

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumspend -> RR deserve, ologit)

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumspend -> RR tryhard, ologit)


* Big government attitudes
sem (RR -> favors conditions deserve tryhard) ///
	(dumgov -> RR)
estat mindices

	
gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumgov -> RR favors, ologit)
	
gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumgov -> RR conditions, ologit)

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumgov -> RR deserve, ologit)

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(dumgov -> RR tryhard, ologit)


* Self-identifications
sem (RR -> favors conditions deserve tryhard) ///
	(conserv -> RR)
estat mindices


gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(conserv -> RR favors, ologit)
	
gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(conserv -> RR conditions, ologit)
	
gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(conserv -> RR deserve, ologit)

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(conserv -> RR tryhard, ologit)

gsem (RR -> favors conditions deserve tryhard, ologit) ///
	(conserv -> RR tryhard conditions deserve, ologit)
